fixed upside down bug