declare frames variable. fixes bug.