error checking added to map methods