add animation to hide and validation