properly handle anchor clicks