Fixed bug where photon position gets queried after it has been removed from application window