added login to both index and detail views