modified attacehment.rb