- adding more error checking