implemented POSIX error code checks