fixed SESSION and login bugs