debug + some checks