Made Filemode changeable