change puts to logger in purge method