basic functions added to models bug fix