added a check for an actual value before calling the function
fixed wrong class names