Adding file handlig for create and update