made it so that the progress bar cant go out of its max