Where was your faith? If you had true faith you would not have to worry about doing good works, they would be an automatic byproduct. It would be your new natural state as a new creature,
Rev 2:5 Remember therefore from whence thou art fallen, and repent, and do the first works; or else I will come unto thee quickly, and will remove thy candlestick out of his place, except thou repent.
Rev 3:2 Be watchful, and strengthen the things which remain, that are ready to die: for I have not found thy works perfect before God.
Rev 3:3 Remember therefore how thou hast received and heard, and hold fast, and repent. If therefore thou shalt not watch, I will come on thee as a thief, and thou shalt not know what hour I will come upon thee.
Tell it to these people,for how did they lack works that Jesus told them to do those works,and they were fallen,and to repent,and the other one their works were not perfect before God,and Jesus told them to repent,and both Churches Jesus said if they do not repent then He would go against them.
And they did have faith,and did repent,and were saved,for they were fallen,and Jesus told them to repent,which means they could get in a right state with Him again.
If it is an automatic response that a person will do works because they are saved,then why the lack of works.
And James would not warn against lacking works if it were not possible that someone might lack works.
In the game of chess if a chess player knows that there is no possible way to win the game,he will not play it out for it will do no good,but a waste of time,and will lay down his king before he is actually checkmated.
You people lay your king down,and quit trying to play it out.