fixed message error, added debug stuff