Fixed checking of existence