add error handler and try and find the debug