Fixed bug with update
Added error checking for input