Changing init function to use promises

Update init function to use promises