added attach model, some validations added