added initialization logic