Fix bug in onBootsrap function