added more checks before adding classes to form to prevent duplicates. fixed a couple bugs found with accessing course values