Help Htc one m8 network problem

I have recently bought a HTC ONE M8, after putting the sim card into the phone it doesn't pick up any signal and shows the message 'Limited Service'.

The same sim card when put in other mobile phones it works fine, gets full signal.

After having cross checked using a couple sim cards in few other phones and in the M8 I have, I am sure that the problem is with the phone not the sim card.

Sometimes after restarting the phone it picks up signal and this signal will be available for sometime and gets back to no signal status ('Limited Service'). This time for which signal will be available is random.

After restarting sometimes the signal comes up and goes nil ('Limited Service') within few minutes and sometimes the signal goes nil ('Limited Service') after 4-5 days.

Please help me out with this issue.

Thank You