Sharepoint function improved