bug fixes, looks like it's working much better now