added sanity check for language and parent