Corrected ordering of conversions and added try/catch