code to wrap tabs