changed prints to logger