optimized/fixed onInstalled listener to always cleanup