fixing the frozen logic