added check for extends-clause