adding selected class and moving it to a widget