Fixes illegal invocation issue