Adding attach method to model