Changes for error logging