better error handling. fix include