Improved Error handling

Also Commented Proposed Part