Extra functions for inserting and updating