Added better exception handling and completed implementation of verify option