using has_key instead of present is better