added magic methods to model