4.6.4

Added error handling to entire code