Added a bug fix for establish and because not running in correct order