implemented all frame type and fix bug