close tabs when push, refactored stupid stuff