added flags to create and check for flag on read