Bugs to fix: crash once popup occurs