fix jump game function