handle return value correctly