Fixed location code. added listener