fixed bug in prediction