Error occured during osx maverics reinstall
I have a late 2011 macbook pro. Yesterday, when i went to turn it on, a grey progress bar appeared under the apple logo and after its done, my mac shuts down. So, i took it to an apple service centre and i was told that it need to be reformatted. So, i backed up my data via target disk and continue to disk utility. After i erased my hard drive, i tried to reinstall osx but it provides an error "an error occured whIle preparing the installation. Try running the installation again". So i ran it again, multiple times and the same error happened.
please help. I urgently need to do my work.
Thank you in advance.
MacBook Pro, OS X Mavericks (10.9.4)