Added function to set status