prevent loading 100 layouts

was copying final layout over and over due to not clearing the variable