Fix error when in designer mode