Fixed StackOverFlow using heritage