Added check for undefined methods