adding return type checking and proper value handling, there is a bug in removing custom get/set