update popup btn functionality

not fully implemented
minor changes to global variables