Updated storing logic