amek sure index is created first before returning