Updating master programmatically