Veritical swipe is working for toptobottom but the same is not working vice versa for bottom to top

@Keyword
def Verticalswipe(String position = ‘’){

	def device_Height = Mobile.getDeviceHeight()

	def device_Width = Mobile.getDeviceWidth()

	int startX = device_Width / 2

	int endX = startX

	int startY = device_Height * 0.30

	int endY = device_Height * 0.70


	if (position.equalsIgnoreCase('toptobottom')){

		Mobile.swipe(startX, endY, endX, startY)

	} else if (position.equalsIgnoreCase('bottomtotop')){

		Mobile.swipe(startX, startY, endX, endY)
	}
}

i am passing the stringposition as toptobottom or bottomtotop