Fixed Main Errors