added logging and fixed position data