Moved log to beginning due to errors