updated for dynamic options