if connect fails return NULL not throw the exception