added error checking code to maker