Fix for recallstates function