I was playing around with my partitions finally now it doesn't boot directly. For it to boot I need to go to HP boot menu and then choose EFI file to boot to load the OS. Something like EFI partition is there but not active boot. However when I checked the flags the drive has boot flag set. Not sure what's wrong. If I don't press F9 while booting and choose EFI file it simply halts saying no OS found.
You may be able to fix it using
bcdedit in Windows, as described here:
Unfortunately, many HPs have a known firmware bug that prevents them from working correctly. If you've got this problem, you'll have to rename your boot loader files so that the firmware thinks it's booting Windows when in fact it's launching GRUB (or rEFInd, or gummiboot, or whatever else you prefer to use as a boot manager). If you're using Ubuntu or a related distribution, the Boot Repair tool can do this job semi-automatically, using an option on the Advanced menu to "back up and rename boot loader files" (or words to that effect; I don't recall the precise wording). Boot Repair might even work on distributions unrelated to Ubuntu, but the odds are better the closer it is to Ubuntu. See this section of a page of mine if you prefer to do it manually.