added some logic to limit the activities to only the valid ones if a project exists in the form