updating frame logic