added logging instead of print