Fix inherit function