error checking in logger
fixed error checking format