Bug fixes and stop buttom implementation