Errors on login, cleaner code

Signed-off-by: Wim Tibackx <wim.tibackx@student.kdg.be>