changed exception syntax to be compatible with 2.4