fixed illegal invocation error