Updated ui animation code