bug fixes and improve update