class choosing bug fix