- Added error checking