introduce expandFrame function