better posid handling and some fixes