remove global var

define framesize inside function