Added the validate() method for course inputs