Added extra error loggin