added a better check for aliases