fixed tie bug properly this time