Added newline at the end of the statement in check_mem()