Fixed bug with empty query raising notice