improved login script a bit