added frame reading