used invalid input exception in in postProfile method.