added code for storing file