delete whitespaces and save func