Fixed DB error

Fixed DB error when other module types exist within the course