Widget switching crashes editor

Thank you Chris. It works.