added saveFrame method