added error return value