how to pop element from dictionary