Need to fix undefined lastmove