Modified Wordpress Plugin

On my Wordpress install (3.5.1) the attribute in query is 'pagename' not 'name'. I also added the empty check because I was getting warning messages on my homepage.