Added activity state + minor modifications