bug fix;

removing last empty query caused exception;