use S_OK and S_ERR