removing the last bit of file