fix a bug in the function *application