added error checking to interface