fixed syntax error version works fine. No memoryleaks has been tested