import fixes and added try catchs