updated with better hr handling