#pragma to ignore the undeclared selector warning
checking for nil to prevent crash