finished putting dbg statement and error codes
fixed merge issue