updated plugin to not throw a moodle exception