Debug logic stuff added