fix error handling and restarting dev server