Changed title function to handle empty title provides.