add class logic works better now