use class_eval to add post functionality