improved error logging in router