add moodle internal checks

Just for some added security.