Tab fixing function works now