fixed, broken listener function