check result of get_terms() for is_wp_error() http://codex.wordpress.org/Function_Reference/get_terms#Return_Values