Use the right operator for checking strings
Map function type correctly