Added extra log lines if an error occurred