add validation directive and error msg animation.