added support for magnetometer