Added Exception handling and skipping of white space.