better handling of js side physics