added errors and warnings printing for debug