Added error checking for ints