Made more robust