Thank you for your reply.
Yes, when the engine is cold it starts right away but then starts to miss. I found out that cylinder 1 and 5 are not working. I checked the compression cold and hot. All cylinders were with in +- 10psi. I switched the injectors and the glow plugs but it did not make any difference. The only solution I found was to turn on the glow plugs manually for about 20 sec after the engine starts.
Could it be the fuel injection pump, but then why turning on the glow plugs makes it better.