Refactor to only open the windows when required. By opening a window on top of another was causing a crash in Android