fix writespaces