Over utilisisation of shared memory improved, probably needs more work - complete run away stopped for now
replaced hard coded id in regex with $id