changed query for getting electives