fix bug pressing buttons while changing frames