null pointer exception fixed when logout