added safety checks to prevent adpredictor crashing on bad data