added try ccatch around model compiling