added opening frame logic