Added some permission checks