Class not given correctly