getCurrentFrame function added