fixed string formatting in function