Fixed server error and logic error