bug fix in frame adding