a fix for better errors only on ruby 1.9 and above