making it a bit more robust