Added onStop Call, put cast to int for Update method (just in case a string is being passed in)

onStop method call was missing.

In addition, I had issues when taking a string value from an ajax request and plugging it into the update method. The pie chart went crazy. I've added a cast to int of the progress variable in the update method to help prevent this issue for others.