Fix for sometimes foundation not running

Fixes DEVELOPER-658