Check fragment type

@astashov please take a look