fixed crash on adding plugin to layout