Added saveFrame functionality