changed the setMax and setProgress method to better handle corner cases
fixed the previous dumb way of handling the progress