added checking for activity existance when adding new activities