I found the answer and the solution on stackoverflow.