changed console.log for printDetails