fixed a minor bug regarding setup code not running properly in some cases