changed q to when and added rest, todo need to update store for storage