improve privilege check