add serialize method to input views