fixes imports
adds error logging