Added error handling
Added error handling