file storing functionality