created functional error logging