adding class avaiability checking