added life cycle listeners