check return-value of open