Updated function in AccessController