catching exception when injecting