These three lines should be inside of the 'if' - no need to execute if no listener