fix js and permissions