Fixed error.message is not a function bug