Updated for changes in nice
Added basic login handling