fixed generate proceeedure method