implementing startup/shutdown sequence