Lots of input exception handling functionalities added.