update code and improve reliability