fixes & error handling