fixes for logic