Removed defadvice and used post-command-hook instead