Corrected / simplied some code related to stab preview
Corrected / simplified some code related to stab preview