implement presence check correctly (fixes #3)