fix panels initialization when setting selected.