added a way to automatically cast attributes