fixed wrong check for rights