Fixed issue in serializing permissions