Modify if then logic in reply view script to handle different data types