Fixed missing permission validation
Small style optimization