fix bug and disable undeclared-selector warning