check return value of strchr