Changed error return to -1