Added checking for extends