checked for :to_proc instead of catching TypeError