Modified to be able to handle type attribute for extended class