updateded header and made synchronous