changed prints to logs