edit method to set bean first