trying to make more robust