split initialize and added try/catch