check permissions fix and ajax path fixes