Updated input
Checking for errors