Fix missing if which was causing the animation to stop after a few seconds

Change-Id: Ie3a47e8cdc155d3f8f7be4005711c75c9ad3fb39