fixed how state is passed from options to main page