logic changes

minor logic changes