changed login routine