Add more error logging