added try loop