Added available flag and before_save functionality and tests