write: updated space check functino commit