emails function added