added try except in calc_return