Modified for UI communication