Added a check on whether the bundle directory exists.