fix issue with coordinate order