added error print and program exit on unsucessfull login