fixed a bufferoverrun
added some checks for stability
increased version