Added permission data and fixed some errors