Added halt funciton