Changed the returning (deprecated in Ruby2) by tap function.