updated codes for UI