adding more error logging