fixing workflow input and adding robust checks and error handling