implemented auto updating and freeing space after that