only allow buffer as input