remove extra endif

Remove extra endif and re-position code for bootanimation.