fix bug for not executing queries