fix return value check