updated code when accessing form