fix a crash which result from the show/hide keyboard animation