added lifecycle methods with logging