check that a model is defined before trying to get the bucket name