Bugfix: call apply when code changes to avoid submitting the previous code