fix logical issue while retrieving log via ajax

found while debugging other stuff

cc @Raydiation @raghunayyar @Kondou-ger @guruz