fix return value of open