added logging and fixed prediction synax error