Fixing usage of calling compile function with callback