updated comments, fixed loadFunc error handling