rewrite progress buttons function