Added check for null input and animation. Still working on a timing issue with the animation