added enum support from @gaddas 's pull request