changes with help of Shayon
preparing for rollback to support has_and_belongs_to_many