fix moodle 2.7 bug