logging in AJAXed and rating calculation added