fixed a few bugs with LS version