fixing loose code