updating to ensure bbox coordinates in right order