- adding better error logging