fixed bug when getting last action from data file