open and close tab work

changed functionality for open and close tab