animation function added to pre loader